import _000GraphBasicProblem as gb

#判断彼得松图有几条哈密顿通路，多少哈密顿回路
V=['a','b','c','d','e','f','g','h','i','j']
E={('a','b'),('b','c'),('c','d'),('d','e'),('e','a'),('a','f'),('b','g'),('c','h'),('d','i'),
   ('e','j'),('f','h'),('g','i'),('h','j'),('i','f'),('j','g')}
v0='a'
paths =gb.Hamiltonpath(V,E,v0)
print(paths)
print(len(paths))
k=0
for path in paths:
    if v0=='a' and path[-1] in ['b','e','f']:
        k=k+1
        print(path)
print(k)